Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make file size uploads configurable via env vars #245

Merged
merged 20 commits into from
Sep 3, 2023

Conversation

DistroByte
Copy link
Contributor

The information contained in an actual budget is now much more detailed than it was previously. Doubling this file size should prevent errors

The information contained in an actual budget is now much more detailed than it was previously. Doubling this file size should prevent errors
@Scot-Survivor
Copy link

Would it not be better to have these configurable via environment variable(s)?

@Scot-Survivor
Copy link

Especially with talks about the idea of a multi-user setup, it may be best to have this configurable.

@DistroByte
Copy link
Contributor Author

I've added them as env vars now

@DistroByte DistroByte changed the title Double file size upload limits. Make file size uploads configurable via env vars Aug 21, 2023
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I really like where you're going with this. Just some small improvements I'd recommend to make :)

src/app.js Outdated Show resolved Hide resolved
src/app.js Outdated Show resolved Hide resolved
src/app.js Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
src/load-config.js Outdated Show resolved Hide resolved
src/load-config.js Outdated Show resolved Hide resolved
Co-authored-by: Matiss Janis Aboltins <[email protected]>
@DistroByte
Copy link
Contributor Author

Let's squash this PR if it gets merged, I am quite happy for people to never come across this atrocity ever again

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there.. :)

Would you mind also doing a test run after you're happy with the changes? Just to verify that it still works as expected.

src/load-config.js Outdated Show resolved Hide resolved
src/load-config.js Outdated Show resolved Hide resolved
@DistroByte
Copy link
Contributor Author

Almost there.. :)

Would you mind also doing a test run after you're happy with the changes? Just to verify that it still works as expected.

Sure thing, is there an image I can pull or am I verifying this outside of docker?

@DistroByte
Copy link
Contributor Author

I can confirm it works as expected with no configuration (defaults), and it also works with any combination of env vars

@MatissJanis
Copy link
Member

Doesn't work for me when using env vars.

@DistroByte
Copy link
Contributor Author

DistroByte commented Aug 24, 2023

@MatissJanis this should be good to go now. Please review below examples, I can write some tests for this also if needs be

$ ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB=500 DEBUG=actual:config node app # set one, replicate to all upload limits
.
.
  actual:config using file sync limit 500mb +0ms
  actual:config using sync encrypted file limit 500mb +0ms
  actual:config using file limit 500mb +1ms
$ ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB=500 DEBUG=actual:config node app # set one, rest remain default
.
.
  actual:config using file sync limit 500mb +0ms
  actual:config using sync encrypted file limit 50mb +1ms
  actual:config using file limit 20mb +0ms
$ ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB=500 DEBUG=actual:config node app # set one, rest remain default
.
.
  actual:config using file sync limit 20mb +0ms
  actual:config using sync encrypted file limit 500mb +0ms
  actual:config using file limit 20mb +0ms
$ ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB=500 ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB=300 DEBUG=actual:config node app # set two, overall file limit remains at default
.
.
  actual:config using file sync limit 300mb +1ms
  actual:config using sync encrypted file limit 500mb +0ms
  actual:config using file limit 20mb +0ms
$ ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB=500 ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB=100 DEBUG=actual:config node app
.
.
  actual:config using file sync limit 100mb +1ms # set by ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB
  actual:config using sync encrypted file limit 500mb +0ms
  actual:config using file limit 100mb +0ms
$ ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB=500 ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB=100 ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB=230 DEBUG=actual:config node app
.
.
  actual:config using file sync limit 230mb +0ms
  actual:config using sync encrypted file limit 500mb +0ms
  actual:config using file limit 100mb +0ms

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for your contribution!

(we are currently in merge freeze until the next release which means only bugfixes and low-risk changes will be merged; I will merge this PR once we've opened up merges again)

@trafico-bot trafico-bot bot added ✅ Approved Pull Request has been approved and can be merged and removed 🔍 Ready for Review labels Aug 24, 2023
@MatissJanis MatissJanis merged commit 6512c46 into actualbudget:master Sep 3, 2023
6 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved Pull Request has been approved and can be merged labels Sep 3, 2023
MMichotte pushed a commit to MMichotte/actual-server that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants